<?php
/**
 * Regular Expression Pattern Rule
 * Validates that a value matches a regular expression pattern.
 * 
 * @package     Q-Validate
 * @subpackage  Rules
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: RegExp.php 37 2010-12-23 02:38:44Z luke.visinoni $
 */
class Q_Rule_RegExp extends Q_Rule_Abstract {

	protected $_params = array (
        'pattern' => '/.*/', 
        'optional' => false
    );
    
    public function isValid($value) {
    
        return $this->_validatePattern($this->getParam('pattern'), $value);
    
    }

}
